import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "datachangelog" })
export class DataChangeLog extends EntityObjectType<DataChangeLog>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        IsIndex: true
    })
    dataRegisterId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    flowNodeId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT,
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT,
    })
    updateTime: number;

    @Define.Column({
        DataType: Define.DataType.JSON,
    })
    data: any;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    status: string;

    /**
     * 操作人
     *
     * @type {string}
     * @memberof DataRegister
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    operatorId: string;

    /**
    * 操作人
    *
    * @type {string}
    * @memberof DataRegister
    */
    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    operatorName: string;


    @Define.Column({
        DataType: Define.DataType.VARCHAR,
    })
    orgId: string;
}

export const DataChangeLogStatus = {
    Pass: 'pass',
    UnPass: 'unpass',
    InReview: 'inReview'
}